var gotop=new Element('a', {
	'class': 'ex-kf-gotop',
	'styles': {
		cursor: 'pointer',
		display: 'none'
	},
	'events': {	
		'click': function(e){
			if(document.body.scrollTop){
			  document.body.scrollTo(0);
			}
			else{
			  document.documentElement.scrollTop = 0;
			}
			this.setStyle('display', 'none');
			return false;
		} 
	}
});
var kfbox = $('qf_kfbox');
var siderbox = $('qf_kfbox').getElement('.ex-kf-siderbar');
var backTopLeft=function(){
	if(Browser.ie6) kfbox.setStyle('position','absolute');
	var btLeft = window.getWidth()/2+610;
	if(btLeft <= 1210){
		kfbox.setStyle('left', 1210);
	}else{
		kfbox.setStyle('right',15);
	}
};
window.addEvents({
	'domready': function(){
		gotop.inject(siderbox,'bottom');
		backTopLeft();
	},
	'scroll': function(){
		if(window.getScrollTop()===0){
			gotop.setStyle('display', 'none');
		}else{
			gotop.setStyle('display', 'block');
			if(Browser.ie6) kfbox.setStyle('top', window.getScrollTop()+window.getHeight()-150);
		}
	},
	'resize':function(){
		backTopLeft();
	}
})